<template>
	<view>
		<view class="problem">
			<view class="title">加入我们</view>
			<view class="list">
				<uni-collapse ref="collapse">
					<uni-collapse-item v-for="(row, index) in problemList" :key="index" thumb="/static/img/q2.png"
						:title="row.title">
						<view class="content">
							<view class="text">
								<rich-text :nodes="row.content"></rich-text>
							</view>
						</view>
					</uni-collapse-item>
				</uni-collapse>
			</view>
		</view>
		<view class="save">
			<view class="btn kf" @click="gocall()">
				电话客服
			</view>
			<view class="btn" @click="tokefu()">
				在线客服
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				problemList: []
			}
		},
		onLoad() {
			uni.showLoading({
				title: '请稍后'
			})
			this.$api.http.get('common-privacy', {key:"HELP"}).then(res => {
				if (res.code ==1) {
					this.problemList = res.data.content.desc;
				}
			})
			uni.hideLoading();
		},
		methods: {
			gocall(tel) {
				uni.makePhoneCall({
					phoneNumber: '4008892875',
					success: (res) => {
						console.log('调用成功!')
					},
					fail: (res) => {
						console.log('调用失败!')
					}

				});
			},
			tokefu() {
				let url = encodeURIComponent(
					'https://kefu.lemaohuishou.com/index/index?code=5Jmr7Xh1Dr9Wu84iJAUuVBp62Atpfp1jden%2BNjKZElMTBCNxRWmXLTou%2FatL7Gdp%2FP7Z18ij'
				)
				uni.navigateTo({
					url: '/pages/webview/webview?url=' + url + '&title=' + '衣之光回收客服'
				})
			}

		}
	}
</script>

<style lang="scss">
	.problem {
		margin: 30rpx auto 0;
		width: 92%;
		overflow: hidden;
		background: #fff;
		border-radius: 20rpx;
		padding: 30rpx;
		box-sizing: border-box;

		.title {
			font-weight: bold;
			color: #333;
			font-size: 30rpx;
			margin-bottom: 30rpx;
		}

		.list {
			margin-bottom: 50rpx;

			.content {
				padding: 0 4% 15px;
				font-size: 28rpx;
				line-height: 45rpx;
				color: #666;

				.text {
					view {
						margin-top: 30rpx;
					}

					p {
						margin-top: 10rpx;
					}
				}
			}

			.uni-collapse,
			.uni-collapse-item__title-box {
				background-color: initial;
				padding: 0;
			}

			.uni-collapse-item__title-img {
				width: 18px;
				height: 18px;
			}

			.uni-icons.data-v-a2e81f6e {
				color: #2291e0 !important;
				font-weight: bold;
			}

			.uni-collapse-item__title-text {
				font-weight: bold;
				font-size: 28rpx;
			}

		}

		.partners {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			margin-bottom: 40rpx;

			image {
				width: 32%;
				border-radius: 10rpx;
				margin-bottom: 20rpx;
			}
		}


	}

	.save {
		view {
			display: flex;
		}

		position: fixed;
		bottom: 0;
		width: 100%;
		height: 140rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #fff;
		padding: 0 20rpx;
		z-index: 999;
		box-sizing: border-box;

		.btn {
			width: 48%;
			height: 90upx;
			border-radius: 10upx;
			background: #4772ed;
			color: #fff;
			justify-content: center;
			align-items: center;
			font-size: 30upx;
			border: 1px solid #4772ed;
		}

		.btn.kf {
			background: #fff;
			color: #4772ed;
		}
	}
</style>